#include <bits/stdc++.h>

using namespace std;


int main() {
    string s1, s2;
    cin >> s1 >> s2;
    bool flag = true;

    if (s1[1] == '.' && s2[0] == '.') flag = false;
    if (s1[0] == '.' && s2[1] == '.') flag = false;

    puts(flag ? "Yes" : "No");
    return 0;
}